<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%-- 使用taglib指令导入jstl标记 --%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>  
<%@ page import="java.util.*" %>     
<%@ page import="com.niit.Student" %>   
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>学生信息</title>
<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
</head>
<body>

<%
 //从request中获取数据，并放到当前jsp页面
 List<Student> data = (List<Student>)request.getAttribute("studentList");
 pageContext.setAttribute("data",data);

%>

<div class="container">
	<h1>学生列表信息：</h1>
	<table class="table table-bordered text-center table-hover table-striped">
		<tr class="table-primary">
			<th>学号</th>
			<th>姓名</th>
			<th>年龄</th>
		</tr>
		<!-- 使用forEach 循环数据-->
		<c:forEach items="${data}" var="stu">
			<tr>
				<td>${stu.id}</td>
				<td>${stu.name}</td>
				<td>${stu.age}</td>
			</tr>
		</c:forEach>
	</table>
</div>



</body>
</html>